angular.module('myApp', ['ionic','myApp.controllers'])

.config(function($stateProvider, $urlRouterProvider) {
  $stateProvider

  .state('tab', {
    url: "/tab",
    abstract:true,
    templateUrl: "templates/tabs.html"
  })

  .state('login', {
          url: '/login',
          templateUrl: "templates/Login.html",
          controller: 'LoginController'

  })
   .state('register', {
          url: '/register',
          templateUrl: "templates/Register.html"
          //controller: 'LoginController'

      })
  .state('tab.msg', {
                url: '/msg',
                views:{
                    'tab-msg':{
                        templateUrl: "templates/msg-tab.html",
                        controller:'MsgTabController'

                    }
    }

  })
  .state('tab.work', {
      url: '/work',
      views:{
          'tab-work':{
              templateUrl: "templates/work-tab.html",
              controller:'WorkTabController'
          }

      }

  })
  .state('tab.my', {
      url: '/my',
      views:{
          'tab-my':{
              templateUrl: "templates/my-tab.html",
              controller:'MyTabController'
          }

      }

  })
  .state('msgdetail', {
          url: '/msgdetail',
       templateUrl: "templates/msg_detail.html"

      })

  .state('daily', {
         url: '/daily',
          templateUrl: "templates/work_daily.html",
          controller:'DailyController'
      })

  .state('weekly', {
          url: '/weekly',
          templateUrl: "templates/work_weekly.html",
          controller:'WeeklyController'
      })

  .state('leave', {
          url: '/leave',
          templateUrl: "templates/work_leave.html",
          controller:'LeaveController'
      })

  $urlRouterProvider.otherwise('/login');

});
